<template>
    <!-- 供应商历史业绩 -->
    <div class="e-table table">
        <div class="top">
            <div class="left">
                <div>
                    <el-button
                        size="small"
                        type="primary"
                        plain
                        @click="aptitudeAddRow"
                        >添加</el-button
                    >
                    <el-button
                        size="small"
                        type="primary"
                        plain
                        @click="handleBatchDownload"
                        v-if="isBatch"
                        >批量下载</el-button
                    >
                    <el-button
                        size="small"
                        type="primary"
                        plain
                        @click="handleBatchDelete"
                        v-if="isBatch"
                        >批量删除</el-button
                    >
                </div>
                <div class="batchBox" @click="batchOperation">
                    <img class="batchicon" src="@/assets/piliang.png" />
                    <span class="batchfont">{{ batch }}</span>
                </div>
            </div>
            <div class="right" v-if="!newFirmPerformance.isTableRowClass">
                <div class="squarecolor">
                    <div class="color colorAdd"></div>
                    <span>新增</span>
                </div>
                <div class="squarecolor item">
                    <div class="color colorUpdate"></div>
                    <span>修改</span>
                </div>
                <div class="squarecolor" style="margin-right: 10px">
                    <div class="color colorDel"></div>
                    <span>删除/过期</span>
                </div>
                <div class="right-div1">
                    <el-input
                        placeholder="请输入查询的内容"
                        v-model="keyword"
                        size="small"
                    >
                        <i slot="suffix" class="el-icon-search like"></i>
                    </el-input>
                </div>
                <div>
                    <el-button
                        size="small"
                        style="background: #2e61d7; color: #fff"
                        @click="search"
                        >搜索</el-button
                    >
                </div>
            </div>
        </div>
        <div class="errorMsg" v-if="errorMsg.length > 0">
            <span
                style="display: block"
                v-for="(item, index) in errorMsg"
                :key="index"
            >
                {{ item }}
            </span>
        </div>
        <el-table
            :data="aptitudeTable"
            border
            style="width: 100%"
            :max-height="$store.state.tableHeight"
            @selection-change="handleDetailSelectionChange"
            @cell-click="cellClick"
            :row-class-name="tableRowClass"
            v-sortTable="{ 'tableData': aptitudeTable, '_this': this, 'ref': 'table' }"
            ref="table"
            class="table"
        >
            <el-table-column
                type="selection"
                width="55"
                v-if="isBatch"
            ></el-table-column>
            <el-table-column fixed label="操作" width="120">
                <template slot-scope="{ row, $index }">
                    <div class="handle">
                        <el-upload
                            style="margin: 7px 5px 0px 0px"
                            class="upload-demo"
                            :action="uploadUrl"
                            :data="{
                                bucketName,
                                relationId,
                                orgCode
                            }"
                            :before-upload="beforeAvatarUpload"
                            :accept="accept"
                            :on-success="attachOnSuccess"
                            :http-request="uploadBefore"
                            :show-file-list="false"
                            name="files"
                        >
                            <img src="@/assets/btn/commit.png" />
                        </el-upload>
                        <img
                            v-if="row.id"
                            src="@/assets/btn/downLoad.png"
                            @click="handleDownload(row)"
                            style="margin-right: 5px"
                        />
                        <img
                            v-if="row.changeType != -1"
                            src="@/assets/btn/delete.png"
                            @click="handleDelete(row, $index)"
                        />
                        <img
                            v-else
                            src="@/assets/btn/cancelDelete.png"
                            @click="revoke(row, $index)"
                        />
                        <img
                            style="margin-left: 10px"
                            src="@/assets/btn/preview.png"
                            @click="preview($index)"
                        />
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                type="index"
                width="55"
                label="序号"
            ></el-table-column>
            <el-table-column
                prop="contractName"
                label="合同名称"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.contractName"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="projectName"
                label="项目名称"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.projectName"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column prop="contractAmount" label="合同金额" width="150">
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.contractAmount"
                        :readonly="row.source == 0"
                        v-enterJustFloat
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>

            <el-table-column prop="startDate" label="开工时间" width="150">
                <template slot-scope="{ row }">
                    <el-date-picker
                        type="date"
                        placeholder="选择日期"
                        value-format="yyyy-MM-dd"
                        v-model="row.startDate"
                        style="width: 100%"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-date-picker>
                </template>
            </el-table-column>
            <el-table-column prop="endDate" label="竣工时间" width="150">
                <template slot-scope="{ row }">
                    <el-date-picker
                        type="date"
                        placeholder="选择日期"
                        value-format="yyyy-MM-dd"
                        v-model="row.endDate"
                        style="width: 100%"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-date-picker>
                </template>
            </el-table-column>
            <el-table-column prop="signingTime" label="签订日期" width="150">
                <template slot-scope="{ row }">
                    <el-date-picker
                        type="date"
                        placeholder="选择日期"
                        value-format="yyyy-MM-dd"
                        v-model="row.signingTime"
                        style="width: 100%"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-date-picker>
                </template>
            </el-table-column>
            <el-table-column
                prop="cumulativeAmount"
                label="累计结算金额"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.cumulativeAmount"
                        v-enterJustFloat
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="projectLeader"
                label="项目负责人"
                width="120"
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.projectLeader"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column prop="witnessName" label="机材负责人" width="120">
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.witnessName"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="witnessTel"
                label="机材负责人联系电话"
                min-width="160"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.witnessTel"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="proxy"
                label="委托代理"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.proxy"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="proxyPhone"
                label="委托代理联系电话"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.proxyPhone"
                        :readonly="row.source == 0"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="opinion"
                label="最新动态评价意见"
                min-width="180"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    <el-input
                        v-model.trim="row.opinion"
                        @change="modifyState(row)"
                    ></el-input>
                </template>
            </el-table-column>
            <el-table-column
                prop="fileName;"
                label="业绩附件"
                min-width="200"
                show-overflow-tooltip
            >
                <template slot-scope="{ row }">
                    {{ row.fileName }}
                </template>
            </el-table-column>
            <el-table-column prop="contractState" label="合同状态" width="120">
                <template slot-scope="{ row }">
                    {{
                        row.source == '1'
                            ? '--'
                            : options.stateArr[row.contractState]
                    }}
                </template>
            </el-table-column>
            <el-table-column prop="source" label="业绩来源" width="120">
                <template slot-scope="{ row }">
                    {{ ['系统内', '系统外'][row.source] }}
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import '@/utils/jquery.scrollTo.min'
import ossRequest from '@/api/oss/oss.js'
// 接口
import Supplier from '@/api/OutsourcingartyAdmin/supplier/supplier'
import supplierChange from '@/api/OutsourcingartyAdmin/supplier/supplierChange'
import { bytesToSize, showLoading, hideLoading } from '@/utils/common'
import service from '@/utils/request'
export default {
    props: {
        // 父组件对象
        newFirmPerformance: {
            /**
             *  billid: '', //单据id
                isTableRowClass: true, //是否展示class
                 isAbroadUnit: '', //是否是境外单位
             */
            type: Object,
            default: () => {
                return {}
            }
        },
        firmPerformanceSend: {
            type: Boolean,
            default: false
        }
    },
    data () {
        return {
            bucketName: 'OutsourcingartyAdmin', //模块名
            isBatch: false, //是否进入批量操作
            batch: '进入批量管理',
            aptitudeTable: [], //表格数据
            checkedDetail: [], //选中的数据
            //上传的地址
            uploadUrl: '/oss/uploader',
            accept: '.jpg,jpeg,.png,.pdf',
            relationId: '',
            pagination: {
                limit: 10, //	每页显示条数
                name: '', //合同名称
                orgName: '', //机构
                page: 1 //当前页数
            },
            totalPage: 0, //总页数
            rowIndex: '',
            certType: [],
            keyword: '', //搜索的字段
            errorMsg: [], //验证数组
        }
    },
    created () {
        // 列表数据
        this.performanceList(this.newFirmPerformance.billid)
    },
    mounted () {},
    computed: {
        orgCode () {
            return this.$store.state.userInfo.orgInfo.shortCode
        }
    },
    methods: {
        //搜索
        search () {
            this.$emit('search', this.keyword)
            this.fun()
        },
        //修改行样式
        tableRowClass ({ row }) {
            if (this.newFirmPerformance.isTableRowClass) {
                return
            } else {
                if (row.state == -1) {
                    return 'red'
                } else if (row.state == 1) {
                    return 'green'
                } else if (row.state == 2) {
                    return 'yellow'
                }
                return ''
            }
        },
        //是否批量管理
        batchOperation () {
            this.isBatch = !this.isBatch
            if (this.isBatch) {
                this.batch = '退出批量管理'
                this.$refs.table.clearSelection()
            } else {
                this.batch = '进入批量管理'
            }
        },
        cellClick (row) {
            //是第几行
            this.rowIndex = this.aptitudeTable.findIndex(x => x === row)
        },
        //添加一行
        aptitudeAddRow () {
            let obj = {
                changeState: 1,
                filePath: '',
                sourceId: '',
                state: 1,
                changeType: 1, //前端操作状态
                contractAmount: '', //合同金额
                contractName: '', //合同名称
                contractState: 0, //合同状态
                contractStateDesc: '', //合同状态
                contractType: 0, //合同类型枚举值(数字)
                contractTypeDesc: '', //合同类型(描述)
                effectiveness: 0, //有效性
                endDate: '', //	竣工时间
                fileName: '', //附件名称
                gmtCreate: '', //创建时间
                id: '', //历史业绩ID
                opinion: '', //	评价意见
                outerBillId: '', //外包方Id
                outerName: '',
                outerTypeKey: '',
                outerTypeValue: '', //外包方类型
                projectLeader: '', //项目负责人
                projectName: '', //项目名称
                projectRemark: '', //工程概况
                relationId: '', //关联ID
                source: 1, //业绩来源 0 系统内 1系统外
                sourceName: 0, //业绩来源中文名称
                startDate: '', //开工时间
                witnessName: '', //	机材负责人
                witnessTel: '', //机材负责人电话
                workContect: '', //所承担工程内容
                signingTime: '', //签订时间
                cumulativeAmount: '', //累计金额
                proxy: '', //	委托代理
                proxyPhone: '', //委托代理电话
                newState: '1', //当期新增字段，判断是当前次新增的数据还是从后端请求回来的数据
                dialogImage: '' //图片预览
            }
            this.aptitudeTable.push(obj)
        },
        //选中的行
        handleDetailSelectionChange (selection) {
            this.checkedDetail = selection
        },
        //删除一行
        handleDelete (row, $index) {
            if (this.isTableRowClass) {
                if (row.id) {
                    this.clientPop(
                        'info',
                        '确定要删除吗？数据删除后不可恢复，请谨慎操作',
                        this.callback(row)
                    )
                } else {
                    this.aptitudeTable.splice($index, 1)
                }
            } else {
                this.clientPop(
                    'info',
                    '确定要删除吗？数据删除后不可恢复，请谨慎操作',
                    this.callbacks(row, $index)
                )
            }
        },
        // 编辑删除回调
        callback (row) {
            return () => {
                row.changeType = -1
                this.$emit('getAptitudeData', row)
            }
        },
        // 变更删除回调
        callbacks (row, index) {
            return () => {
                if (!row.newState) {
                    this.aptitudeTable[index].changeType = -1
                    this.aptitudeTable[index].state = -1
                } else {
                    this.aptitudeTable.splice(index, 1)
                }
            }
        },
        // 撤销
        revoke (row, index) {
            if (row.sourceId) {
                this.aptitudeTable[index].state = this.oldDate[index].state
            } else {
                this.aptitudeTable[index].state = 1
            }
            this.aptitudeTable[index].changeType = 0
        },

        //批量删除
        handleBatchDelete () {
            const length = this.checkedDetail.length
            this.clientPop(
                'info',
                `已选择【${length}】条数据，确定要删除吗？删除的数据可以在【回收站】还原或彻底删除。`,
                this.delete
            )
        },
        delete () {
            this.checkedDetail.forEach(item => {
                if (item.outerBillId && item.state != -1) {
                    const newArr = []
                    newArr.push(item)
                    newArr.forEach(item => {
                        this.$set(item, 'changeState', -1)
                        this.$set(item, 'state', -1)
                    })
                    this.$refs.table.clearSelection()
                } else {
                    const localArr = []
                    localArr.push(item)
                    for (let i = this.aptitudeTable.length; i > 0; i--) {
                        for (let j = 0; j < localArr.length; j++) {
                            if (this.aptitudeTable[i - 1] === localArr[j]) {
                                this.aptitudeTable.splice(i - 1, 1)
                            }
                        }
                    }
                    this.$refs.table.clearSelection()
                }
            })
        },
        //批量下载
        handleBatchDownload () {},
        //文件大小
        beforeAvatarUpload (file) {
            const isLt2M = file.size / 1024 / 1024 < 20

            if (!isLt2M) {
                this.clientPop('err', '上传文件大小不能超过 20MB！')
            }
            return isLt2M
        },
        //上传成功
        attachOnSuccess () {
            this.getObjectByRelationId()
        },
        //获取上传成功的对象
        getObjectByRelationId () {
            if (!this.relationId) return
            return ossRequest
                .getObjectByRelationId({ relationId: this.relationId })
                .then(res => {
                    res.map(x => {
                        x.fileName = x.objectName
                        return scrollX
                    })
                    this.$set(
                        this.aptitudeTable[this.rowIndex],
                        'dialogImage',
                        res[0].objectPath
                    )
                    this.$set(
                        this.aptitudeTable[this.rowIndex],
                        'fileName',
                        res[0].objectName
                    )
                    this.$set(
                        this.aptitudeTable[this.rowIndex],
                        'relationId',
                        this.relationId
                    )
                })
        },
        bytesToSize (byte) {
            return bytesToSize(byte)
        },
        //覆盖默认的上传行为，可以自定义上传的实现
        uploadBefore (params) {
            this.$Ajax
                .httpGet({
                    url: '/uid/builder?num=1',
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                .then(res => {
                    params.data.relationId = res[0]
                    this.relationId = res[0]
                    let obj = {
                        ...params.data,
                        files: params.file
                    }
                    this.$Ajax
                        .httpPostForm({
                            url: this.uploadUrl,
                            params: obj
                        })
                        .then(() => {
                            this.attachOnSuccess()
                        })
                })
                .catch(error => {
                    this.clientPop('err', error, this.handleClose)
                })
        },
        //保存
        preserve () {
            this.errorMsg = []
            //如果不是境外单位则必填一条数据
            if (this.newFirmPerformance.isAbroadUnit == '0') {
                // 判断是否存在有效数据
                let data = this.aptitudeTable.some(item => {
                    return item.changeType != -1
                })
                if (data) {
                    let isStr = false
                    this.aptitudeTable.forEach((item, index) => {
                        let str1 = `请完善第 ${index + 1} 行的`
                        if (
                            item.contractName === '' ||
                            item.contractName === null
                        ) {
                            let str = '合同名称,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.projectName === '' ||
                            item.projectName === null
                        ) {
                            let str = '项目名称,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.contractAmount === '' ||
                            item.contractAmount === null
                        ) {
                            let str = '合同金额,'
                            isStr = true
                            str1 += str
                        }
                        if (item.startDate === '' || item.startDate === null) {
                            let str = '开工时间,'
                            isStr = true
                            str1 += str
                        }
                        if (item.endDate === '' || item.endDate === null) {
                            let str = '竣工时间,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.signingTime === '' ||
                            item.signingTime === null
                        ) {
                            let str = '签订日期,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.cumulativeAmount === '' ||
                            item.cumulativeAmount === null
                        ) {
                            let str = '累计结算金额,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.projectLeader === '' ||
                            item.projectLeader === null
                        ) {
                            let str = '项目负责人,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.witnessName === '' ||
                            item.witnessName === null
                        ) {
                            let str = '机材负责人,'
                            isStr = true
                            str1 += str
                        }

                        if (item.proxy === '' || item.proxy === null) {
                            let str = '委托代理,'
                            isStr = true
                            str1 += str
                        }

                        if (item.opinion === '' || item.opinion === null) {
                            let str = '最新动态评价意见,'
                            isStr = true
                            str1 += str
                        }
                        if (item.fileName === '' || item.fileName === null) {
                            let str = '业绩附件,'
                            isStr = true
                            str1 += str
                        }
                        if (
                            item.witnessTel === '' ||
                            item.witnessTel === null
                        ) {
                            let str = '机材负责人联系电话,'
                            isStr = true
                            str1 += str
                        } else {
                            if (!/^1[3-9]\d{9}$/.test(item.witnessTel)) {
                                let str = '机材负责人联系电话格式不正确！'
                                isStr = true
                                str1 += str
                            }
                        }
                        if (
                            item.proxyPhone === '' ||
                            item.proxyPhone === null
                        ) {
                            let str = '委托代理联系电话,'
                            isStr = true
                            str1 += str
                        } else {
                            if (!/^1[3-9]\d{9}$/.test(item.proxyPhone)) {
                                let str = '委托代理联系电话格式不正确！'
                                isStr = true
                                str1 += str
                            }
                        }
                        if (
                            Date.parse(item.startDate) >=
                            Date.parse(item.endDate)
                        ) {
                            let str = '结束时间必须大于开始时间,'
                            isStr = true
                            str1 += str
                        }
                        if (isStr) {
                            this.errorMsg.push(str1)
                        }
                    })
                    if (this.errorMsg.length > 0) {
                        this.$emit('update:firmPerformanceSend', false)
                        this.$emit('setError', 'firmPerformance')
                        return
                    } else {
                        // 将数据传给父组件
                        this.aptitudeTable.map(item => {
                            item.outerBillId = this.newFirmPerformance.billid
                        })
                        this.$emit('update:firmPerformanceSend', true)
                        this.$emit(
                            'update:firmPerformanceTable',
                            this.aptitudeTable
                        )
                    }
                } else {
                    this.errorMsg.push('必须包含至少一条有效数据')
                    this.$emit('update:firmPerformanceSend', false)
                    this.$emit('setError', 'firmPerformance')
                }
            } else {
                this.$emit('update:firmPerformanceSend', true)
            }
        },
        // 列表
        async performanceList (val) {
            if (this.newFirmPerformance.isTableRowClass) {
                let data = await Supplier.supplierAchievementList({
                    billId: val,
                    keyword: ''
                })
                this.aptitudeTable = data
            } else {
                // 变更业绩列表
                let data = await supplierChange.supplierPerformanceChangeList({
                    billId: val,
                    keyword: ''
                })

                if (data.length > 0) {
                    this.aptitudeTable = data
                }
                this.oldDate = JSON.parse(JSON.stringify(this.aptitudeTable))
            }
        },
        // 修改样式
        modifyState (row) {
            if (this.oldDate) {
                this.oldDate.map(item => {
                    if (item.id == row.id && row.sourceId) {
                        // if( !this.isObjectValueEqual(item, row)) {
                        this.aptitudeTable.map(items => {
                            if (items.id == row.id) {
                                return (items.state = 2)
                            }
                        })
                        // }
                    }
                })
            }
        },
        //预览附件
        preview (val) {
            if (this.aptitudeTable[val].dialogImage) {
                window.open(this.aptitudeTable[val].dialogImage)
            } else {
                this.clientPop('err', '请先上传附件')
            }
        },
        //下载某一行
        async handleDownload (obj) {
            showLoading()
            const url = obj.dialogImage
            const fileNameFull = obj.fileName
            const fileExt = fileNameFull.split('.').pop()
            if (
                ['jpg', 'jpeg', 'gif', 'png', 'bmp'].indexOf(
                    fileExt.toLowerCase()
                ) === -1
            ) {
                const { httpGetFile } = service
                const data = await httpGetFile({ url })
                const blob = new Blob([data])
                const reader = new FileReader()
                reader.readAsDataURL(blob)
                reader.onload = function (e) {
                    this.autoClick({
                        fileName: fileNameFull,
                        url: e.target.result
                    })
                }.bind(this)
            } else {
                this.downloadIamge(url, fileNameFull)
            }
            hideLoading()
        },
        downloadIamge (imgsrc, fileName) {
            //下载图片地址和图片名
            var image = new Image()
            // 解决跨域 Canvas 污染问题
            image.setAttribute('crossOrigin', 'anonymous')
            image.onload = function () {
                const canvas = document.createElement('canvas')
                canvas.width = image.width
                canvas.height = image.height
                const context = canvas.getContext('2d')
                context.drawImage(image, 0, 0, image.width, image.height)
                const _dataURL = canvas.toDataURL('image/png') //得到图片的base64编码数据

                const blob_ = this.dataURLtoBlob(_dataURL) // 用到Blob是因为图片文件过大时，在一部风浏览器上会下载失败，而Blob就不会

                const url = {
                    name: fileName || '图片.png', // 图片名称不需要加.png后缀名
                    src: blob_
                }

                if (window.navigator.msSaveOrOpenBlob) {
                    // if browser is IE
                    navigator.msSaveBlob(url.src, url.name) //filename文件名包括扩展名，下载路径为浏览器默认路径
                } else {
                    this.autoClick({
                        fileName: url.name,
                        url: window.URL.createObjectURL(url.src)
                    })
                }
            }.bind(this)
            image.src = imgsrc
        },
        dataURLtoBlob (dataurl) {
            var arr = dataurl.split(','),
                mime = arr[0].match(/:(.*?);/)[1],
                bstr = window.atob(arr[1]),
                n = bstr.length,
                u8arr = new Uint8Array(n)
            while (n--) {
                u8arr[n] = bstr.charCodeAt(n)
            }
            return new Blob([u8arr], { type: mime })
        },
        autoClick ({ fileName, url }) {
            const elink = document.createElement('a')
            elink.download = fileName
            elink.style.display = 'none'
            elink.href = url
            document.body.appendChild(elink)
            elink.click()
            document.body.removeChild(elink)
        }
    }
}
</script>

<style lang="scss" scoped>
.like {
    color: rgb(46, 97, 215);
    font-size: 17px;
    line-height: 30px;
    cursor: pointer;
}
.handle {
    display: flex;
    align-items: center;
    text-align: left;
    div {
        cursor: pointer;
    }
    .download {
        font-size: 23px;
        font-weight: bold;
        color: rgb(122, 168, 24);
    }
}
</style>
